<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="stylesheet" type="text/css" href="<%=path %>/static/css/css.css?1" />
<link rel="stylesheet" type="text/css" href="<%=path %>/static/jquery-ui/jquery-ui.min.css" />
<script type="text/javascript" src="<%=path %>/static/js/json2.js"></script>
<script type="text/javascript" src="<%=path %>/static/js/jquery.js"></script>
<script type="text/javascript" src="<%=path %>/static/jquery-ui/jquery-ui.min.js"></script>
<script type="text/javascript" src="<%=path %>/static/layer/layer.js"></script>
<script type="text/javascript" src="<%=path %>/static/utf8-jsp/ueditor.config.js"></script>
<script type="text/javascript" src="<%=path %>/static/utf8-jsp/ueditor.all.js"></script>
<script type="text/javascript" src="<%=path %>/static/js/gridview.js?v=1"></script>
<script type="text/javascript" src="<%=path %>/static/js/formview.js?v=1"></script>
<script type="text/javascript" src="<%=path %>/static/js/tool.js"></script>
<script type="text/javascript" src="<%=path %>/static/js/validate.js"></script>

<SCRIPT type="text/javascript">
    <!--
    var formSetting = {
    		po:'QhTaskCentre',
    		title:"任务中心编辑",
    		formid:"formedit",
    		hiddens:["id","createUser","createDateTime","modifyUser","modifyDateTime","state"],
    	fields:[
    	     [
				{tdwidth:100,title:"标题",type:"text",name:"title",width:300,datatype:"Require",msg:"请输入标题！"}
    		 ],
             [
                {title:"类别",type:"select",name:"type",width:"304",datatype:"Require",msg:"请选择类别！"}
             ],
             [
                {title:"金额",type:"text",name:"cashMoney",width:"300",datatype:"Money",msg:"请输入金额！"}
             ],
             [
                {title:"数量",type:"text",name:"num",width:"300"}
             ],
             [
                {title:"开始日期",type:"datetime",name:"startDate",width:"300"}
             ],
             [
                {title:"结束日期",type:"datetime",name:"endDate",width:"300"}
             ],
             [
                {title:"详情",type:"text",name:"note",width:"300"}
             ]
             ],
		toolbar:{align:'right',buttons:[
		                 			  {
		                 			    	 id:'save',
		                 			    	 title:'保存',
		                 			    	 handlers:{
		                 			    		 click: function(){
		                 			    			 if(!Validator.Validate(document.getElementById('formedit'),0)){
		                 			    			    return;
		                 			    			 }
		                 			    			 form.save(function(ret) {
		                 			    				if (ret == -1) {
		                 			    					layer.alert("数据保存失败，请重试！");
		                 			    				} else {
		                 			    					layer.msg("数据已保存！");
		                 			    				}
		                 			    			});
		                 			    		 }
		                 			    	 }
		                 			     }
		                 			 ]}
    }

	var form;
    $(document).ready(function(){
    	form = new FormView("formview",formSetting);
    	form.init();

    	var typehtml="<option value=''>==请选择==</option>";
        typehtml+="<option value='新手任务'>新手任务</option>";
        typehtml+="<option value='每日任务'>每日任务</option>";
        typehtml+="<option value='活动任务'>活动任务</option>";
        typehtml+="<option value='等级任务'>等级任务</option>";
        $("select[name=type]").html(typehtml);

    	var id='<%=request.getParameter("id")%>';
    	if(id!=null&&id!=""){
    	   form.loadData(id, "QhTaskCentre");
    	}

		ajustHeight();
    });

    //-->
</SCRIPT>
</head>

<body>
<div id="formview0" class="rbox1"></div>
<div id="formview" class="rbox1"></div>
<div id="list" class="rbox2"></div>

<script type="text/javascript" src="<%=path %>/static/js/underscore.js"></script>
<script type='text/javascript' src='<%=path %>/static/My97DatePicker/WdatePicker.js'></script>
<script type='text/javascript' src='<%=path %>/dwr/engine.js'></script>
<script type='text/javascript' src='<%=path %>/dwr/util.js'></script>
<script type='text/javascript' src='<%=path %>/dwr/interface/BaseDwr.js'></script>
</body>
</html>